<?php /* Smarty version Smarty-3.0.9, created on 2013-05-15 04:56:18
         compiled from "escribir_historia.php" */ ?>
<?php /*%%SmartyHeaderCode:516551931572f274a2-98702730%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    'f863746a13c46d7c7889f0c4f40b7445807f6f56' => 
    array (
      0 => 'escribir_historia.php',
      1 => 1368593776,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '516551931572f274a2-98702730',
  'function' => 
  array (
  ),
  'has_nocache_code' => false,
)); /*/%%SmartyHeaderCode%%*/?>
<<?php ?>?php
/*
 * Favor tener cuidado con la siguiente ruta. Si ingresa este archivo dentro de una carpeta en
 * el framework, es necesario agregar ../ al comienzo de la ruta.
 */
require('../configs/include.php');
/*
 * Clase crear historia (historia)
 */

class c_historia extends super_controller {
    
    public function registrar(){
        $historia = new historia($this->post);
        $options = "normal";

        $this->orm->connect();
        $this->orm->insert_data($options, $historia);
        $this->orm->close();

        $this->img_warning = "correct.png";
        $this->type_warning = "success";
        $this->msg_warning = "La historia ha sido registrada satisfatoriamente";
        $this->engine->assign('type_warning', $this->type_warning);
        $this->engine->assign('msg_warning', $this->msg_warning);
        $this->temp_aux = 'message.tpl';
    }
    
    
    public function display() {
        $this->engine->assign('title', 'Escribir Historia');
        $this->engine->display('header.tpl');

         
        if ($this->error == 1) {
            $this->engine->assign('obj', $this->post);
            $this->engine->assign('type_warning', $this->type_warning);
            $this->engine->assign('msg_warning', $this->msg_warning);
            $this->temp_aux = 'message.tpl';
        }
        $this->engine->display($this->temp_aux);
        $this->engine->display('escribir_historia.php');
        
        $this->engine->display('escribir_historia.tpl');
        $this->engine->display('footer.tpl');   
    }

    public function run() {
       try {
            if (isset($this->get->option)) {
                $this-><?php echo $_smarty_tpl->getVariable('this')->value->get->option;?>
();
            }
        } catch (Exception $e) {
            $this->error = 1;
            $this->img_warning = 'incorrect.png';
            $this->msg_warning = $e->getMessage();
        }
        $this->display();
    }

}

$call = new c_historia();
$call->run();
?<?php ?>>
